<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Electrical {

            constructor(brand, name, size) {
                this.brand = brand;
                this.name = name;
                this.size = size;
            }

            blowing() {
                console.log(this.name + "能吹风");
            }
            refrigeration() {
                console.log(this.name + "能制冷");
            }


        }

        var chuifengji = new Electrical(1, "吹风机", 300);
        chuifengji.blowing();
        console.log(chuifengji);
        var dianbingxiang = new Electrical(2, "冰箱", 200);
        dianbingxiang.refrigeration();
        console.log(dianbingxiang);
    </script>
</body>

</html>